<?php
header('Content-type:text/html;charset=utf-8');
date_default_timezone_set('PRC');
function p($var){
	echo '<pre style="background:#ccc;border-radius:4px;padding:10px;">';
	print_r($var);
	echo '</pre>';
}
if($_SERVER['REQUEST_METHOD'] == 'POST'){
	define('IS_POST',true);
}else{
	define('IS_POST', false);
}

function success($msg,$url){
	$str = <<<str
<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8" />
	<title></title>
	<script src="./public/jquery.js"></script>
	<style type="text/css">
		.box{
			position: absolute;
			top: 0;
			left: 0;
			right: 0;
			bottom: 0;
			background: #DBDBDB;
		}
		.box p{
			width: 200px;
			height: 200px;
			text-align: center;
			line-height: 200px;
			margin:200px auto;
			border-radius:50% ;
			background:lavender;
			-webkit-box-shadow:0 0 10px rgba(0, 204, 204, .5);  
			-moz-box-shadow:0 0 10px rgba(0, 204, 204, .5);  
			box-shadow:0 0 10px rgba(0, 204, 204, .5);
		}
		.box p span{
			font-size: 100px;
			color:  rosybrown;

		}
		.msg{
			text-align: center;
		}
		h2{
			text-align: center;
			margin: 50px;
		}
	</style>
</head>
<body>
	<div class="box">
		<h2>秒后返回<a href="{$url}">点击跳转</a></h2>
		<p><span class="seconds">3</span></p>
		
		<div class="msg"></div>
	</div>
	<script>
		$('.msg').text('{$msg}');
		var timer = setInterval(function () {
			var i = $('.seconds').text();
			i --;
			if(i<0) {
				i = 0;
				clearInterval(timer);
				window.location.href='{$url}';
			}
			$('.seconds').html(i);
		},1000)
	</script>
</body>
</html>
str;
	echo $str;
}

function success1($msg,$url){
	$str = <<<str
<script>
alert('{$msg}');
location.href='{$url}';
</script>
str;
	echo $str;
}























 ?>